/*
 * This file is part of JContextFree.
 *
 * JContextFree is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 *
 * JContextFree is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with JContextFree.  If not, see <http://www.gnu.org/licenses/>.
 */

package it.enricod.jcontextfree.engine.model;

import it.enricod.jcontextfree.engine.model.vo.Position2D;

/**
 * @deprecated TO BE DELETED
 * @author enrico
 *
 */
public class FigureParameters
{

	private Position2D position;
	private Position2D contextPosition;

	private double rotation;
	private double contextRotation;
	private double scale;
	private double contextScale = 1.0d;
	private double flip = 0d;
	private double contextFlip = 0d;
	private double brightness = 0d;
	private double contextBrightness = 0d;

	public Position2D getContextPosition()
	{
		return contextPosition;
	}

	public void setContextPosition(Position2D contextPosition)
	{
		this.contextPosition = contextPosition;
	}

	public double getContextRotation()
	{
		return contextRotation;
	}

	public void setContextRotation(double contextRotation)
	{
		this.contextRotation = contextRotation;
	}

	public double getContextScale()
	{
		return contextScale;
	}

	public void setContextScale(double contextSize)
	{
		this.contextScale = contextSize;
	}

	public double getContextFlip()
	{
		return contextFlip;
	}

	public void setContextFlip(double contextFlip)
	{
		this.contextFlip = contextFlip;
	}

	public double getContextBrightness()
	{
		return contextBrightness;
	}

	public void setContextBrightness(double contextBrightness)
	{
		this.contextBrightness = contextBrightness;
	}

	public FigureParameters()
	{
		scale = JContextFreeConstants.FIGURE_DEFAULT_SIZE;
		rotation = 0d;
		contextRotation = 0d;
		position = Position2D.createInstance(0d, 0d);
		contextPosition = position;
	}

	public double getSize()
	{
		return scale;
	}

	public Position2D getPosition()
	{
		return position;
	}

	public void setPosition(Position2D position)
	{
		this.position = position;
	}

	public void setSize(double size)
	{
		this.scale = size;
	}

	public void setRotation(double rotation)
	{
		this.rotation = rotation;
	}

	public double getRotation()
	{
		return rotation;
	}

	public double getFlip()
	{
		return flip;
	}

	public void setFlip(double flip)
	{
		this.flip = flip;
	}

	public double getBrightness()
	{
		return brightness;
	}

	public void setBrightness(double brightness)
	{
		this.brightness = brightness;
	}

	/**
	 * posizione assoluta.
	 * 
	 * @return
	 */
	public double getAbsoluteX()
	{
		return contextPosition.getX() + position.getX();
	}

	public double getAbsoluteY()
	{
		return contextPosition.getY() + position.getY();
	}

	public double getAbsoluteS()
	{
		return contextScale * scale;
	}

	public double getAbsoluteR()
	{
		return rotation + contextRotation;
	}

}
